package com.bangdream.michelia.entity;

import android.os.Parcel;
import android.os.Parcelable;

import com.alibaba.fastjson.JSON;
import com.bangdream.michelia.entity.courses.CoursesBean;

/**
 * @date on 2018/8/12 22:33
 * @email 909732184@qq.com
 * 收藏的实体类 字段不一样不能直接用课程的
 */
public class CollectionBean implements Parcelable{

    /**
     * id : 01952bb5757b4a988812d868fb9921b7
     * createBy : 1
     * createTime : 2018-08-12 18:53:13
     * updateBy : 1
     * updateTime : 2018-08-12 18:53:13
     * delFlag : 0
     * orgId : a
     * createName : admin
     * userId : 1
     * courseId : 75f3d1b9a7fd469abc80f5c1ec623d44
     * course : {"id":"75f3d1b9a7fd469abc80f5c1ec623d44","createBy":"1","createTime":"2018-07-24 18:05:45","updateBy":"1","updateTime":"2018-08-12 18:52:40","delFlag":"0","orgId":"a","createName":"admin","name":"教你唱歌课程","faceUrl":"http://inesa-test.oss-cn-shanghai.aliyuncs.com/byl/1532397793383937724.png","courseClassifiId":"9450ef95179941a384e678508143b870","publicState":"2","period":271,"isOrder":"1","status":"0","viewCount":0,"collectCount":3,"buyCount":0,"chapterCount":1,"pageNumber":0,"introduction":"<p><span style=\"color:#CC0000\">教你唱歌<\/span><span style=\"color: rgb(51, 51, 51); font-family: arial; font-size: 13px; background-color: rgb(255, 255, 255);\">,从小白到会唱歌,专业老师独特教法,让<\/span><span style=\"color:#CC0000\">唱歌<\/span><span style=\"color: rgb(51, 51, 51); font-family: arial; font-size: 13px; background-color: rgb(255, 255, 255);\">爱好者短期内学会<\/span><span style=\"color:#CC0000\">唱歌<\/span><span style=\"color: rgb(51, 51, 51); font-family: arial; font-size: 13px; background-color: rgb(255, 255, 255);\">.老师在线直播,免费学<\/span><span style=\"color:#CC0000\">唱歌<\/span><span style=\"color: rgb(51, 51, 51); font-family: arial; font-size: 13px; background-color: rgb(255, 255, 255);\">,<\/span><span style=\"color:#CC0000\">教你<\/span><span style=\"color: rgb(51, 51, 51); font-family: arial; font-size: 13px; background-color: rgb(255, 255, 255);\">快速上手<\/span><\/p>","isPushPlat":"2"}
     */

    private String id;
    private String createBy;
    private String createTime;
    private String updateBy;
    private String updateTime;
    private String delFlag;
    private String orgId;
    private String createName;
    private String userId;
    private String courseId;
    private CoursesBean course;

    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getCreateBy() {
        return createBy;
    }

    public void setCreateBy(String createBy) {
        this.createBy = createBy;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getUpdateBy() {
        return updateBy;
    }

    public void setUpdateBy(String updateBy) {
        this.updateBy = updateBy;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    public String getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(String delFlag) {
        this.delFlag = delFlag;
    }

    public String getOrgId() {
        return orgId;
    }

    public void setOrgId(String orgId) {
        this.orgId = orgId;
    }

    public String getCreateName() {
        return createName;
    }

    public void setCreateName(String createName) {
        this.createName = createName;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getCourseId() {
        return courseId;
    }

    public void setCourseId(String courseId) {
        this.courseId = courseId;
    }

    public CoursesBean getCourse() {
        return course;
    }

    public void setCourse(CoursesBean course) {
        this.course = course;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.id);
        dest.writeString(this.createBy);
        dest.writeString(this.createTime);
        dest.writeString(this.updateBy);
        dest.writeString(this.updateTime);
        dest.writeString(this.delFlag);
        dest.writeString(this.orgId);
        dest.writeString(this.createName);
        dest.writeString(this.userId);
        dest.writeString(this.courseId);
        dest.writeParcelable(this.course, flags);
    }

    public CollectionBean() {
    }

    protected CollectionBean(Parcel in) {
        this.id = in.readString();
        this.createBy = in.readString();
        this.createTime = in.readString();
        this.updateBy = in.readString();
        this.updateTime = in.readString();
        this.delFlag = in.readString();
        this.orgId = in.readString();
        this.createName = in.readString();
        this.userId = in.readString();
        this.courseId = in.readString();
        this.course = in.readParcelable(CoursesBean.class.getClassLoader());
    }

    public static final Creator<CollectionBean> CREATOR = new Creator<CollectionBean>() {
        @Override
        public CollectionBean createFromParcel(Parcel source) {
            return new CollectionBean(source);
        }

        @Override
        public CollectionBean[] newArray(int size) {
            return new CollectionBean[size];
        }
    };
}
